<!DOCTYPE HTML>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport"
		content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no,email=no,date=no,aItemress=no">
	<title>选择发票</title>
	<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
	<link rel="stylesheet" type="text/css" href="../../css/app.css" />
	<style type="text/css">
		.address-list {
			background-color: #FFFFFF;
			padding: 0 0.75rem;
			margin-bottom: 0.5rem;
		}

		.aui-input,
		input[type="text"],
		input[type="password"],
		input[type="search"],
		input[type="email"],
		input[type="tel"],
		input[type="url"],
		input[type="date"],
		input[type="datetime-local"],
		input[type="time"],
		input[type="number"],
		select,
		textarea {
			font-size: 0.75rem;
			text-align: right;
			/*color: #CCCCCC!important;*/
		}

		.aui-list .aui-list-item {
			min-height: 2.5rem;
			line-height: 2.5rem;
		}

		.aui-list .aui-list-item-label {
			width: 6.6rem;
			font-size: .75rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(34, 34, 34, 1);
		}

		img {
			width: 1.5rem;
		}

		.sel-lable {
			display: inline-block;
			width: 3.5rem;
			text-align: center;
			height: 1.5rem;
			border-radius: .75rem;
			font-size: .7rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(51, 51, 51, 1);
			line-height: 1.5rem;
			background: rgba(238, 238, 238, 1);
			margin-right: 0.5rem;
		}

		.sel-lable.active {
			color: #fff;
			background: #005A93
		}

		.aui-btn-block {
			display: inline-block;
			width: 17.25rem;
			height: 2.3rem;
			line-height: 2.3rem;
			border-radius: 0.3rem;
			color: #FFFFFF;
			background: #005A93;

		}

		.btn-frame {
			width:100%;
			position: fixed;
			bottom:0.75rem;
			text-align: center;
		}

		::placeholder {
			font-size: .75rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(187, 187, 187, 1);
			text-align: left;
		}

		.info {
			display: flex;
			width: 100%;
			height: 2.75rem;
			line-height: 2.75rem;
			border-bottom: 1px solid rgba(238, 238, 238, 0.5);
		}

		.info>div:nth-child(1) {

			text-align: left;
			font-size: .75rem;
			width: 3.6rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(51, 51, 51, 1);
		}

		.info .zz {
			width: 5.6rem !important
		}

		.vlist img {
			width: 2rem;
			float: right;
			margin-top: 0.65rem
		}

		.info>div:nth-child(2) {

			flex: 72;
		}

		.info>div:nth-child(2) input {
			margin-top: .3rem;
			text-align: left;
			font-size: 15px;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(51, 51, 51, 1);
		}

		.info b {
			color: #F73024;
			font-weight: 400;
		}

		.info input {
			margin-left: 0.5rem;
		}

		.imgInfo img {
			width: 1.25rem;
			height: 1.25rem;
			float: right;
			margin-top: -1.6rem
		}

		.item{
			width:100%;padding:0.75rem;background:#fff;position: relative;margin-top:0.5rem;box-sizing: border-box;
		}
		.wrapper{position: relative;}
		.selectCurrent{
			position: absolute;right:0.75rem; display: inline-block;top:20%
		}
		.item .title{display: inline-block;width:4.2rem;}
		.box{height:3.5rem;width:100%}
	</style>
</head>

<body>
	<div class="" id="app" v-cloak="">
		<div class="wrapper">
			<div class="item" @click="no_receipt">
				<span>不开发票</span>
			</div>
		</div>

		<div class="wrapper" v-for="vo in info" @click="setReceipt(vo)" >

			<div class="item" v-if="vo.type=='单位'">
				<div><span class="title">发票抬头：</span><span>{{vo.person}}</span></div>
				<div><span class="title">税号：</span><span>{{vo.num}}</span></div>
				<div class="selectCurrent">
					<span style="display:inline-block;float:left;margin-top:.7rem;margin-right:.45rem;margin-top:0.58rem">
						<img v-if="vo.is_default=='1'" src="../../image/icon/select_new.png" style="width:0.95rem;height:0.95rem;">
					</span>
			   </div>
			</div>
			<div class="item" v-if="vo.type=='个人'">
				<div><span>{{vo.person}}</span></div>
				<div class="selectCurrent">
					<span style="display:inline-block;float:left;margin-top:.7rem;margin-right:.45rem;margin-top:0.58rem">
						<img v-if="vo.is_default=='1'" src="../../image/icon/select_new.png" style="width:0.95rem;height:0.95rem;">
					</span>
			   </div>
			</div>
		</div>

		<div class="box"></div>
		<!-- <div class="btn-frame" tapmode tapmode @click="open_win('receipt','receipt.html',false)">
			<div class="aui-btn aui-btn-block"
				style="font-size:0.8rem;font-family:PingFangSC-Regular;font-weight:400;color:rgba(255,255,255,1);">
				新建发票
			</div>
		</div> -->
	</div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/vue.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/aui-dialog.js"></script>
<script type="text/javascript" src="../../res/bluemark_3_city.js"></script>
<script>
	var vm = new Vue({
		el: "#app",
		data: {
			id: 0,
			receipt_person: '',
			receipt_type: '个人',
			receipt_name: '',
			receipt_num: '',
			receipt_phone: '',
			receipt_address: '',
			receipt_account: '',
			receipt_bank: '',
			is_default: 0,
			address: '',
			info:[]
		},
		methods: {
			get_list: function () {
				get_data('api/Receipt/viaReceiptList', {
					token: $api.getStorage('token')
				}, function (ret) {
					console.log(JSON.stringify(ret))
					if (ret.status) {

						vm.info = ret.data

					}
				})
			},
			no_receipt(){
				send_event('no_receipt')
				delay_close()

			},
			setReceipt(el){
				console.log(JSON.stringify(el))
				if(el.status!==1){
					toast('发票审核中');
					return false;
				}
				send_event('receipt_select', {
					receipt: el
				})
				delay_close()
			}

		}
	})
	apiready = function () {
		vm.get_list()
		add_event('receipt_change', function (ret) {
			vm.get_list()
		})
	};

</script>

</html>
